home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / langs / iconv8_l.arc / PROGS.ARC / gcomp.icn < prev    next >
Encoding:
Text File  |  1990-03-08  |  1.1 KB  |  38 lines

  1. ############################################################################
  2. #
  3. #    Name:    gcomp.icn
  4. #
  5. #    Title:    Produce complement of file specification
  6. #
  7. #    Author:    William H. Mitchell, modified by Ralph E. Griswold    
  8. #
  9. #    Date:    December 27, 1989
  10. #
  11. ############################################################################
  12. #
  13. #     This program produces a list of the files in the current directory
  14. #  that do not appear among the arguments.  For example,
  15. #  
  16. #       gcomp *.c
  17. #  
  18. #  produces a list of files in the current directory that do
  19. #  not end in .c.  As another example, to remove all the files
  20. #  in the current directory that do not match Makefile, *.c, and *.h
  21. #  the following can be used:
  22. #  
  23. #       rm `gcomp Makefile *.c *.h`
  24. #  
  25. #  The files . and .. are not included in the output, but other
  26. #  `dot files' are.
  27. #
  28. ############################################################################
  29.  
  30. procedure main(args)
  31.    local files
  32.    files := set()
  33.    read(open("echo * .*","rp")) ? while insert(files,tab(upto(' ') | 0)) do
  34.       move(1) | break
  35.    every delete(files,"." | ".." | !args)
  36.    every write(!sort(files))
  37. end
  38.